﻿using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;

namespace OrderSystem.Templet
{
    public partial class FormTemplet : Form
    {
        private static Color s_startColor = Color.FromArgb(126, 166, 255);

        private static Color s_endColor = Color.FromArgb(248, 248, 248);

        private static float s_angle = 0f;

        public FormTemplet()
        {
            InitializeComponent();
        }

        protected override void OnResize(EventArgs e)
        {
            base.Invalidate();
            base.OnResize(e);
        }

        protected override void OnPaintBackground(PaintEventArgs e)
        {
            if (base.ClientRectangle.Width != 0 && base.ClientRectangle.Height != 0)
            {
                LinearGradientBrush linearGradientBrush = new LinearGradientBrush(base.ClientRectangle, FormTemplet.s_startColor, FormTemplet.s_endColor, FormTemplet.s_angle);
                e.Graphics.FillRectangle(linearGradientBrush, base.ClientRectangle);
                linearGradientBrush.Dispose();
            }
        }
    }
}
